A=read.csv("C:/本科生教学/大三/R/实践3/ADdate实践3-2.csv")
rownames(A)=A[,2]
A=A[,-1]
A=A[,-1]
class(A)
a=unlist(A)
hist(a,border = "black",main = "ADdata的主要情况",xlab = "主要范围",ylab = "数量情况",col="purple")
a1=log10(a)
hist(a1,border = "black",col="purple",main = "ADdata的对数主要情况",xlab = "log10(x)",ylab = "数量情况")
B=read.csv("C:/本科生教学/大三/R/实践5/GSE67835.csv")
rownames(B)=B[,1]
B=B[,-1]
class(B)
b=unlist(B)
hist(b,border = "black",col="green",main = "GSE67835的主要情况")
dev.off()



library(ggplot2)
library(ggrepel)
C=prostat
C$sig[(-1*log10(C$P) < -1*log10(C$P)|C$P=="NA")|C$FC < FC& C$FC> -FC] <- "NotSig"
C$sig[C$P <= 0.05 & C$FC >= 0.2630344] <- "Up"
C$sig[C$P <= 0.05 & C$FC <= -0.2630344] <- "Down"
volcanoplot=ggplot(C, aes(C$FC,-1*log10(C$P)))+
           geom_point(aes(color = sig))+
            scale_color_manual(values=c("blue","red","grey"))+
            labs(title="volcanoplot",
                 x="FC", 
                 y="-log10(P)")+
            geom_hline(yintercept = -log10(0.05),linetype = 'dashed', size = 0.2)+        # 在图上添加虚线
            geom_vline(xintercept=c(-0.2630344,0.2630344),linetype = 'dashed', size = 0.2)+ # 在图上添加虚线
            geom_text_repel(data = C,
                            aes(label = ID), 
                            alpha = 0.7,
                            max.overlaps = 50,
                            size=3,
                            box.padding=unit(0.5,'lines'),           # 标记的边距
                            point.padding=unit(0.1, 'lines'))
ggsave(volcanoplot,filename = "volcanoplot2.0.jpg")
dev.off()

D=A
names(D)
d<-dist(D,method = "euclidean")
tree=hclust(d,method="average")
plot(tree,
     ylab="Height",
     main="ADdata")
dev.off()